﻿
using Admin.NET.Core;

namespace Admin.NET.Application.Entity;

/// <summary>
/// 设备从机点信息
/// </summary>
[SugarTable("DeviceSlaveTemplatePoints", "从机变量")]
public class DeviceSlaveTemplatePoints : EntityBase
{
    /// <summary>
    /// 变量类型
    /// </summary>
    [Required]
    [SugarColumn(ColumnName = "PointType", ColumnDescription = "变量类型")]
    public int PointType { get; set; }

    /// <summary>
    /// 变量名字
    /// </summary>
    [Required]
    [SugarColumn(ColumnName = "PointName", ColumnDescription = "变量名字", Length = 100)]
    public string PointName { get; set; }

    /// <summary>
    /// 设备从机模板Id
    /// </summary>
    [Required]
    [SugarColumn(ColumnName = "DeviceSlaveTemplateId", ColumnDescription = "设备从机模板Id")]
    public long DeviceSlaveTemplateId { get; set; }

    /// <summary>
    /// 变量标识符
    /// </summary>
    [SugarColumn(ColumnName = "DataIdentifier", ColumnDescription = "变量标识符", Length = 32)]
    public string? DataIdentifier { get; set; }

    /// <summary>
    /// 千分位
    /// </summary>
    [SugarColumn(ColumnName = "Millennials", ColumnDescription = "千分位")]
    public int? Millennials { get; set; }

    /// <summary>
    /// 数据类型
    /// </summary>
    [Required]
    [SugarColumn(ColumnName = "DataType", ColumnDescription = "数据类型")]
    public DataType DataType { get; set; }

    /// <summary>
    /// 长度
    /// </summary>
    [SugarColumn(ColumnName = "Len", ColumnDescription = "长度", Length = 32)]
    public string? Len { get; set; }

    /// <summary>
    /// 寄存器地址
    /// </summary>
    [Required]
    [SugarColumn(ColumnName = "reg", ColumnDescription = "寄存器地址", Length = 32)]
    public string reg { get; set; }

    /// <summary>
    /// 寄存器类型
    /// </summary>
    [Required]
    [SugarColumn(ColumnName = "RegType", ColumnDescription = "寄存器类型")]
    public RegType RegType { get; set; }

    /// <summary>
    /// 变量类型
    /// </summary>
    [SugarColumn(ColumnName = "VarType", ColumnDescription = "变量类型", Length = 32)]
    public string? VarType { get; set; }

    ///// <summary>
    ///// 精确几位
    ///// </summary>
    [SugarColumn(ColumnName = "PrecisionEnum", ColumnDescription = "精确几位")]
    public PrecisionEnum PrecisionEnum { get; set; }

    /// <summary>
    /// 单位
    /// </summary>
    [SugarColumn(ColumnName = "Unit", ColumnDescription = "单位", Length = 32)]
    public string? Unit { get; set; }

    /// <summary>
    /// 读写属性
    /// </summary>
    [Required]
    [SugarColumn(ColumnName = "ReadWrite", ColumnDescription = "读写属性")]
    public ReadWrite ReadWrite { get; set; }

    /// <summary>
    /// 存储方式
    /// </summary>
    [SugarColumn(ColumnName = "Store", ColumnDescription = "存储方式", Length = 32)]
    public StoreType? Store { get; set; }

    /// <summary>
    /// 采集频率
    /// </summary>
    [Required]
    [SugarColumn(ColumnName = "Cycle", ColumnDescription = "采集频率")]
    public CycleType Cycle { get; set; }

    [SugarColumn(IsIgnore = true)]
    public string DataValue { get; set; }

    /// <summary>
    /// 采集公式
    /// </summary>
    [SugarColumn(ColumnName = "Formula", ColumnDescription = "采集公式", Length = 32)]
    public string? Formula { get; set; }

    /// <summary>
    /// 控制公式
    /// </summary>
    [SugarColumn(ColumnName = "ReFormula", ColumnDescription = "控制公式", Length = 32)]
    public string? ReFormula { get; set; }
    /// <summary>
    /// 获取数据的时间
    /// </summary>
    [SugarColumn(IsIgnore =true)]

    public DateTime? GetValueTime { get; set; }
}